#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :api_05.py
# @Time      :2024/11/12 19:10
# @Author    :zhou_yi

from fastapi import APIRouter
from fastapi.responses import FileResponse, HTMLResponse
from service.fn_three_price import *

a05 = APIRouter()


# 模版生成三方比价--word文件
@a05.post('/three_price')
async def get_three_price_file(In: InputThreePrice):
    path, download_filename = await file_three_price(In)
    if path:
        res = FileResponse(path, filename=download_filename)
        return res
    else:
        return HTMLResponse(content='生成文件发生错误', status_code=501)
# 模版生成合同word--文件
# 模版生成清运记录word--文件
